public class digui2 {
    public static void main(String[] args) {
        int nowDay=10;
        int num=1;
        int day=1;
        System.out.println("猴子在第一天摘了"+total(day,nowDay,num)+"个桃子");
    }
    public static int total(int day,int nowDay, int num){
        int sum;
        if (nowDay==day){
            System.out.println("第"+day+"天有桃子："+num);
            return num;
        }else {
            sum=(total(day+1,nowDay,num)+1)*2;
        }
        System.out.println("第"+day+"天有桃子："+sum);
        return sum;
    }
}